﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Epic.Net.Extensions
{
    internal static class GenericExtensions
    {
        public static T Do<T>(this T value, Func<T, T> action)
        {
            return action(value);
        }

        public static T Do<T>(this T value, Func<T> action)
        {
            return action();
        }

        public static T Action<T>(this T value, Action<T> action)
        {
            if (action != null)
                action(value);
            return value;
        }

        public static T Action<T>(this T value, Action action)
        {
            if (action != null)
                action();
            return value;
        }
    }

}
